/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package model;
import java.util.Vector;
import javax.swing.*;
import javax.swing.table.DefaultTableModel;
/**
 *
 * @author asus-pc
 */
public class ShopCart {
    
    public Vector add(Shopitem it,Vector ve){
        ve.add(it.getId());
        ve.add(it.getName());
        ve.add(it.getPrice());
        return ve;
    }
    
    public void delete(int count,int length,DefaultTableModel dtm){
        for(int i=0;i<length;i++){
           dtm.removeRow(count);
        }
    }
    
    public int sum(int row[],int value[]){
        int m=0;
        for(int i=0;i<row.length;i++){
            m+=value[i];
        } 
        return m;
    }
    
}
